import java.util.Scanner;

public class B_1_31 {
    public static void main(String[] args) {
        int t;
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()){
            int num = 0;
            t = sc.nextInt();
            if (t==0)
                break;
            while (true){
                if (t==1||t==0)
                    break;
                if (t>=2){
                    num++;
                    t = t-2;
                }
            }
                System.out.println(num);
        }
    }
}
